package com.wwe.kotlinstudy.util

/**
 * @name KotlinStudy
 * @package name：com.wwe.kotlinstudy.util
 * @anthor DavidZhang
 * @time 2018/4/17 14:40
 * @class describe
 */
class ForStudy {

    fun test1() {
        for(i in 1 until 100) {
            //等价于[1,100)
        }
    }

    fun test2() {
        for(i in 1..100) {
            //等价于[1,100]
        }
    }

    fun test3() {
        for(i in 1..10 step 2) {
            print(i)
        }
    }

    fun test4() {
        for(i in 9 downTo 0 step 3) {
            print(i) //倒序迭代数字,输出
        }
    }


}